package git.jas0nch.boottest.controller;

import git.jas0nch.boottest.pojo.Employee;
import git.jas0nch.boottest.service.IEmployeeService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.configurationprocessor.json.JSONObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.ws.Response;
import java.util.Collection;

/**
 * projectName : boottest
 * className: EmployeeController
 * description: TODO 类描述
 *
 * @author : git.jas0nch
 * date: 2022-02-17
 */

@RestController
@RequestMapping("/employee")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class EmployeeController {

    private final IEmployeeService employeeService;

    @GetMapping("/all.html")
    public Collection<Employee> getAll(){

        System.out.println("查询员工信息");
        Collection<Employee> employees = employeeService.getEmployees();

        return employees;
    }
}
